home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cpptutor.arc / EMPLOYE2.CPP < prev    next >
Text File  |  1991-04-28  |  2KB  |  72 lines

  1.                                       // Chapter 11 - Program 8
  2. #include "iostream.h"
  3. #include "person.hpp"
  4. #include "supervsr.hpp"
  5. #include "elemlist.hpp"
  6.  
  7. employee_list list;
  8.  
  9. main()
  10. {
  11. supervisor *suppt;
  12. programmer *progpt;
  13. secretary *secpt;
  14.  
  15.    cout << "XYZ Staff -- note salary is monthly.\n\n";
  16.  
  17.    suppt = new supervisor;
  18.    suppt->init_data("Big John", 5100, "President");
  19.    list.add_person(suppt);
  20.  
  21.    progpt = new programmer;
  22.    progpt->init_data("Joe Hacker", 3500, "debugger", "Pascal");
  23.    list.add_person(progpt);
  24.  
  25.    progpt = new programmer;
  26.    progpt->init_data("OOP Wizard", 7700, "senior analyst", "C++");
  27.    list.add_person(progpt);
  28.  
  29.    secpt = new secretary;
  30.    secpt->init_data("Tillie Typer", 2200, 1, 85);
  31.    list.add_person(secpt);
  32.  
  33.    suppt = new supervisor;
  34.    suppt->init_data("Tom talker", 5430, "Sales manager");
  35.    list.add_person(suppt);
  36.  
  37.    progpt = new programmer;
  38.    progpt->init_data("Dave Debugger", 5725, "code maintainer", 
  39.                                                 "assembly language");
  40.    list.add_person(progpt);
  41.  
  42.                   // Now display the entire list
  43.    list.display_list();
  44.  
  45.    cout << "End of employee list.\n";
  46. }
  47.  
  48.  
  49.  
  50.  
  51. // Result of execution
  52.  
  53. // XYZ Staff -- note salary is monthly.
  54. //
  55. // Supervisor --> Big John's salary is 5100 and is the President.
  56. //
  57. // Programmer --> Joe Hacker's salary is 3500 and is debugger.
  58. //                Joe Hacker's specialty is Pascal.
  59. //
  60. // Programmer --> OOP Wizard's salary is 7700 and is senior analyst.
  61. //                OOP Wizard's specialty is C++.
  62. //
  63. // Secretary ---> Tillie Typer's salary is 2200.
  64. //                Tillie typer types 85 per minute and can take shorthand.
  65. //
  66. // Supervisor --> Tom Talker's salary is 5430 and is the sales manager.
  67. //
  68. // Programmer --> Dave Debugger's salary is 5725 and is code maintainer.
  69. //                Dave Debugger's specialty is assembly language.
  70. //
  71. // End of employee list.
  72.